﻿<phone:PhoneApplicationPage 
    xmlns:local="clr-namespace:RGBFinder"
    local:TiltEffect.IsTiltEnabled="True"
    x:Class="RGBFinder.NewGamePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True"
    Loaded="PhoneApplicationPage_Loaded"
    BackKeyPress="PhoneApplicationPage_BackKeyPress"
    
    >
    <!--xmlns:mmi="clr-namespace:mmiWP7SDK;assembly=WP7SDK"-->
	<phone:PhoneApplicationPage.Resources>
		<ControlTemplate x:Key="PhoneSimpleRepeatButton" TargetType="RepeatButton">
    <Rectangle Fill="Transparent"/>
</ControlTemplate>
<ControlTemplate x:Key="ThumbControlTemplate1" TargetType="Thumb">
    <Rectangle Fill="{StaticResource PhoneForegroundBrush}"  Height="60" Width="50" />
</ControlTemplate>

<Style x:Key="SliderStyle1" TargetType="Slider">
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="Maximum" Value="10"/>
    <Setter Property="Minimum" Value="0"/>
    <Setter Property="Value" Value="0"/>
    <Setter Property="Background" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
    <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Slider">
                <Grid Background="Transparent">
                    <VisualStateManager.VisualStateGroups>
                      
                    </VisualStateManager.VisualStateGroups>
                    <Grid x:Name="HorizontalTemplate" Margin="{StaticResource PhoneHorizontalMargin}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="0"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle x:Name="HorizontalTrack" Grid.ColumnSpan="3" Fill="{TemplateBinding Background}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50" Opacity="0.2"/>
                        <Rectangle x:Name="HorizontalFill" Grid.Column="0" Fill="{TemplateBinding Foreground}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50"/>
                        <RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                        <RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                        <Thumb x:Name="HorizontalThumb" Grid.Column="1" Margin="-1,0,0,30" RenderTransformOrigin="0.5,0.5" Template="{StaticResource ThumbControlTemplate1}" Width="1">
                            <Thumb.RenderTransform>
                                <ScaleTransform ScaleY="1" ScaleX="32"/>
                            </Thumb.RenderTransform>
                        </Thumb>
                    </Grid>
                    <Grid x:Name="VerticalTemplate" Margin="{StaticResource PhoneVerticalMargin}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="0"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Rectangle x:Name="VerticalTrack" Fill="{TemplateBinding Background}" IsHitTestVisible="False" Margin="12,0" Opacity="0.2" Grid.RowSpan="3" Width="12"/>
                        <Rectangle x:Name="VerticalFill" Fill="{TemplateBinding Foreground}" IsHitTestVisible="False" Margin="12,0" Grid.Row="2" Width="12"/>
                        <RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" IsTabStop="False" Grid.Row="0" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                        <RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" IsTabStop="False" Grid.Row="2" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                        <Thumb x:Name="VerticalThumb" Height="1" Margin="0,-1,0,0" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Template="{StaticResource ThumbControlTemplate1}">
                            <Thumb.RenderTransform>
                                <ScaleTransform ScaleY="32" ScaleX="1"/>
                            </Thumb.RenderTransform>
                        </Thumb>
                    </Grid>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

<!--<Slider Style="{StaticResource SliderStyle1}" />-->
	</phone:PhoneApplicationPage.Resources>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="100"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle" Text="{Binding Path=Strings.Title, Source={StaticResource LocalizedStrings }}" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock x:Name="PageTitle" Text="{Binding Path=Strings.NewGame, Source={StaticResource LocalizedStrings }}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="151*" />
                <ColumnDefinition Width="76*" />
                <ColumnDefinition Width="76*" />
                <ColumnDefinition Width="151*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="40*" />
                <RowDefinition Height="60*" />
                <RowDefinition Height="40*" />
                <RowDefinition Height="40*" />
                <RowDefinition Height="60*" />
                <RowDefinition Height="70*" />
                <RowDefinition Height="80*" />
                <!--<RowDefinition Height="90" />-->
            </Grid.RowDefinitions>

            <TextBlock Padding="10" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" Text="{Binding Path=Strings.Timer, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Left" Name="Timer_Area"/>
            <TextBlock Padding="10" Grid.Column="3" Grid.Row="2" Grid.ColumnSpan="1" Text="{Binding Path=Strings.Tests, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Left" Name="Tests_Area"/>

            <TextBlock Padding="10" Grid.Row="0" Grid.Column="0" Text="{Binding Path=Strings.SecretColor, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center"/>
            <TextBlock Padding="10" Grid.Column="3" Text="{Binding Path=Strings.YourColor, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center"/>

            <TextBox Name="Red_Area" Grid.Row ="4"  KeyUp="Red_Area_KeyUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" GotFocus="Red_Area_GotFocus" LostFocus="Red_Area_LostFocus" TextAlignment="Center">
                <TextBox.InputScope>
                    <InputScope>
                        <InputScopeName NameValue="TelephoneNumber"/>
                    </InputScope>
                </TextBox.InputScope>
            </TextBox>
            <TextBox Name="Green_Area" Grid.Row ="4" Grid.Column="1"  KeyUp="Green_Area_KeyUp" Grid.ColumnSpan="2"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" GotFocus="Green_Area_GotFocus" LostFocus="Green_Area_LostFocus" TextAlignment="Center">
                <TextBox.InputScope>
                    <InputScope>
                        <InputScopeName NameValue="TelephoneNumber"/>
                    </InputScope>
                </TextBox.InputScope>
            </TextBox>
            <TextBox Name="Blue_Area" Grid.Row ="4" Grid.Column="3" KeyUp="Blue_Area_KeyUp" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" GotFocus="Blue_Area_GotFocus" LostFocus="Blue_Area_LostFocus" TextAlignment="Center">
                <TextBox.InputScope>
                    <InputScope>
                        <InputScopeName NameValue="TelephoneNumber"/>
                    </InputScope>
                </TextBox.InputScope>
            </TextBox>
            <Button Grid.Row="5" Content="{Binding Path=Strings.Red, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="24" Name="RedButton" Click="RedButton_Click"/>
            <Button Grid.Row="5" Grid.Column="1" Content="{Binding Path=Strings.Green, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="24" Name="GreenButton" Click="GreenButton_Click" Grid.ColumnSpan="2" />
            <Button Grid.Row="5" Grid.Column="3" Content="{Binding Path=Strings.Blue, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="24" Name="BlueButton" Click="BlueButton_Click"/>

            <Button Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Content="{Binding Path=Strings.Test, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalContentAlignment="Center" FontSize="24" Name="TestButton" Click="TestButton_Click"/>

            <TextBlock Padding="10"  Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="1" Text="{Binding Path=Strings.Match, Source={StaticResource LocalizedStrings }}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center"/>

            <TextBlock Padding="10" Name="Match_Area" Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="1" Text="a" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Visibility="Collapsed" FontSize="32"/>

            <!--<Button Content="{Binding Path=Strings.OtherProducts, Source={StaticResource LocalizedStrings }}" Grid.Row="7" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" Name="Ads1_Button" VerticalAlignment="Stretch" Click="Ads1_Button_Click" />-->
            <Rectangle HorizontalAlignment="Stretch" Name="SecretColor_Rectangle" Stroke="Black" StrokeThickness="1" VerticalAlignment="Stretch" Grid.Row="1" Grid.Column="0" MouseLeftButtonUp="SecretColor_Rectangle_MouseLeftButtonUp"/>
            <Rectangle HorizontalAlignment="Stretch" Name="YourColor_Rectangle" Stroke="Black" StrokeThickness="1" VerticalAlignment="Stretch" Grid.Row="1" Grid.Column="3"/>

            <!--<Slider Style="{StaticResource SliderStyle1}" ManipulationStarted="Slider_ManipulationStarted" Grid.Row="6" HorizontalAlignment="Stretch" Name="Slider" VerticalAlignment="Stretch" Grid.ColumnSpan="4" IsEnabled="False" ValueChanged="Slider_ValueChanged" Maximum="255" SmallChange="1" Width="400" Value="0" />-->

            <local:PhoneSlider Minimum="0" Style="{StaticResource sliderStyle}" Grid.Row="6" HorizontalAlignment="Stretch" x:Name="Slider" VerticalAlignment="Stretch" Grid.ColumnSpan="4" IsEnabled="False" ValueChanged="Slider_ValueChanged" Maximum="255" SmallChange="1"/>

            <TextBlock Padding="10" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="1" Text="a" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Name="Match_R_Area" Visibility="Collapsed"/>
            <TextBlock Padding="10" Grid.Column="1" Grid.Row="3" Grid.ColumnSpan="2" Text="a" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Name="Match_G_Area" Visibility="Collapsed"/>
            <TextBlock Padding="10" Grid.Column="3" Grid.Row="3" Grid.ColumnSpan="1" Text="a" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" TextAlignment="Center" Name="Match_B_Area" Visibility="Collapsed"/>
        </Grid>
        
        <Grid Name="AdControlGrid" xmlns:adctl="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" Grid.Row="2">
            <adctl:AdControl Name="AdControl" Height="80" Width="480" AdUnitId="54316" ApplicationId="a2733e2a-0279-4d2a-ac92-cf7dfb30dbde" AdModel="Contextual" Visibility="Visible"  AdEngaged="AdControl_AdEngaged" AdDisengaged="AdControl_AdDisengaged"/>
        </Grid>

        <!--43443    28911-->
        <!--<mmi:MMAdView x:Name="mmAdView" Background="Transparent" Height="60" Width="480"
                      VerticalAlignment="Center" Apid="43443"
                      RefreshTimer="60" AdType="MMBannerAdTop"
                      Grid.Row="2"  MMAdFailure="mmAdView_MMAdFailure" MMOverlayOpened="mmAdView_MMOverlayOpened" MMOverlayClosed="mmAdView_MMOverlayClosed" Visibility="Visible"/>-->
    </Grid>

    

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>-->
            <!--<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>-->
            <shell:ApplicationBar.MenuItems>
                <!--<shell:ApplicationBarMenuItem Text="MenuItem 1"/>-->
                <!--<shell:ApplicationBarMenuItem Text="MenuItem 2"/>-->
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
